﻿using UnityEngine;
using UnityEngine.UI;


class MonsterHpUI : MonoBehaviour
{
    private Slider hpSlider;
    private RectTransform recTrans;
    private Canvas canvas;


    private void Start()
    {
        hpSlider = GetComponentInChildren<Slider>();
        canvas = GetComponent<Canvas>();
    }

    public void SetSliderValue(float curValue, float maxValue)
    {
        hpSlider.value = 1- (curValue / maxValue);
    }

    private void Update()
    {
        canvas.transform.rotation = Camera.main.transform.rotation;
    }
}
